package com.yy.community.modules.comment.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.sql.Timestamp;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.sql.Clob;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yy.community.common.validator.group.AddGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;

/**
 * <p>
 * 
 * </p>
 *
 * @author 司马缸砸缸了
 * @since 2019-07-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("COMMENT")
public class Comment implements Serializable {


    @TableId(value = "ID")
    private String id;

    @NotBlank(message = "用户ID不能为空", groups = AddGroup.class)
    @TableField("USER_ID")
    private String userId;

    @NotBlank(message = "用户名不能为空", groups = AddGroup.class)
    @TableField("USER_NAME")
    private String userName;

    @NotBlank(message = "评论内容不能为空", groups = AddGroup.class)
    @TableField("CONTENT")
    private String content;

    @NotBlank(message = "文章ID不能为空", groups = AddGroup.class)
    @TableField("ARTICLE_ID")
    private String articleId;

    @TableField("PARENT_ID")
    private Integer parentId;

    @TableField("REPLY_USER_ID")
    private String replyUserId;

    @TableField("REPLY_USER_NAME")
    private String replyUserName;

    @TableField("LIKE_NUM")
    private Integer likeNum;

    @NotBlank(message = "层级不能为空", groups = AddGroup.class)
    @TableField("COMMENT_LEVEL")
    private Integer commentLevel;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("CREATE_TIME")
    private Timestamp createTime;


}
